import javax.microedition.sensor.LightSensorInfo;
import javax.microedition.sensor.TouchSensorInfo;
import javax.microedition.sensor.UltrasonicSensorInfo;

import lejos.nxt.SensorPort;


public class EngineCheck {
	
	public EngineCheck(){
		
	}
	
	/**
	 * Check if all the sensor are ON
	 * @return boolean
	 */
	public static boolean startToCheck(){
		
		//UltrasonicSensor
	 UltrasonicSensorInfo infoUltraSonic = new UltrasonicSensorInfo();		 
	 infoUltraSonic.setPortNumber(Eyes.ULTRASONIC_PORT.getId());
	 	 
	 TouchSensorInfo infoTouchLeft = new TouchSensorInfo();
	 TouchSensorInfo infoTouchRight = new TouchSensorInfo();
	 
	 LightSensorInfo infoLight = new LightSensorInfo();
	 infoLight.setPortNumber(Tapefinder.LIGHT_PORT.getId());
	 
	 
	 infoTouchLeft.setPortNumber(TouchSensors.LEFT_PORT.getId());
	 infoTouchRight.setPortNumber(TouchSensors.RIGHT_PORT.getId());
	 
	 if(!infoUltraSonic.isAvailable()){
		 Alarm.errorAlarm("UltraSonic SENSOR is not avalible");
		 return false;
	 }else if(!infoLight.isAvailable()){
		 Alarm.errorAlarm("LIGHT SENSOR is not avalible");
		 return false;
	 }else if (!infoTouchLeft.isAvailable()){
		 Alarm.errorAlarm("TOUCH LEFT SENSOR is not avalible");
		 return false;
	 }else if (!infoTouchRight.isAvailable()){
		 Alarm.errorAlarm("TOUCH RIGHT SENSOR is not avalible");
		 return false;
	 }
		
		return true;
	}

	
}
